package org.nepu.srr.设备设施本体风险.功能试验.循环系统;

import lombok.Data;
import org.nepu.sc.domain.DataVO;
import org.nepu.sc.domain.CommonMethods;

@Data
public class B222CirculationSystemParams {
    //搅拌器空载荷、载荷运转（合格/不合格）
    DataVO test1;

    //振动筛空载运转（合格/不合格）
    DataVO test2;

    //混合泵/加重泵试验（合格/不合格）
    DataVO test3;

    //泥浆泵组试验（合格/不合格）
    DataVO test4;

    //灰罐气密性试验（合格/不合格）
    DataVO test5;

    public B222CirculationSystemResult rate(){
        double fullScore = 35;
        double rateScore = 0;
        if (test1.getData().equals("合格")){
            rateScore += 5;
        }
        if (test2.getData().equals("合格")){
            rateScore += 10;
        }
        if (test3.getData().equals("合格")){
            rateScore += 5;
        }
        if (test4.getData().equals("合格")){
            rateScore += 10;
        }
        if (test5.getData().equals("合格")){
            rateScore += 5;
        }
        double rate = rateScore / fullScore;
        B222CirculationSystemResult result = new B222CirculationSystemResult();
        result.setRateScore(rate);
        String s = CommonMethods.toGrade(rate);
        result.setRateResult(s);
        return result;
    }
}
